package
{
	import flash.display.Loader;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.net.URLRequest;
	

	public class ImgLoader extends EventDispatcher
	{
		public var loader:Loader;
		public var url:String;
		public var point:*;
		public function ImgLoader(url:String,point:* = null)
		{
			super();
			this.url = url;
			this.point = point;
			
		}
		public function load():void{
			loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadcomplete);
			loader.load(new URLRequest(this.url));
		}
		private function loadcomplete(event:Event):void{
			loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,loadcomplete);
			dispatchEvent(new Event(Event.COMPLETE));
		}
	}
}